﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000165 RID: 357
	[Serializable]
	public class WorldObject : WorldObjectBaseC
	{
		// Token: 0x0600085C RID: 2140 RVA: 0x00031804 File Offset: 0x0002FA04
		public virtual void Initialize()
		{
			this.gameObject = this.transform.gameObject;
			this.rigidbody = this.gameObject.GetComponent<Rigidbody>();
			this.renderer = this.transform.GetComponentInChildren<Renderer>();
			this.meshFilter = this.transform.GetComponentInChildren<MeshFilter>();
			if (this.meshFilter != null)
			{
				this.mesh = this.meshFilter.sharedMesh;
				if (this.mesh != null)
				{
					this.vertexPositions = this.mesh.vertices;
					this.normals = this.mesh.normals;
					this.initialized = true;
				}
				else
				{
					this.initialized = false;
				}
			}
			this.cachedId = this.gameObject.GetInstanceID();
		}

		// Token: 0x0600085D RID: 2141 RVA: 0x000318D0 File Offset: 0x0002FAD0
		public virtual void Update()
		{
			if (this.mesh != null)
			{
				this.vertexPositions = this.mesh.vertices;
				if (this.updateNormals)
				{
					this.normals = this.mesh.normals;
				}
			}
		}

		// Token: 0x0600085E RID: 2142 RVA: 0x00031910 File Offset: 0x0002FB10
		public virtual WorldObject Clone()
		{
			return new WorldObject
			{
				gameObject = this.gameObject,
				transform = this.transform,
				rigidbody = this.rigidbody,
				renderer = this.renderer,
				meshFilter = this.meshFilter,
				mesh = this.mesh,
				updateNormals = this.updateNormals
			};
		}

		// Token: 0x0400085C RID: 2140
		[HideInInspector]
		public Renderer renderer;
	}
}
